// fourType.ts
import axios from 'axios';

// 删除标签
export const deleteFourType = (id: number) => {
  return axios.post('/demandFourType/delete', { id });
};

// 新增/修改
export const saveFourType = (data: {
  id?: number;
  parentId: number;
  name: string;
  info: string;
  status: number;
}) => {
  return axios.post('/demandFourType/saveFourType', data);
};

// 获取列表
export const getFourTypeList = (
  current: number,
  pageSize: number,
  name: string,
  status: number
) => {
  return axios.get('/demandFourType/getList', {
    params: { current, pageSize,name: name ,status:status||''},
  });
};

// 获取标签详情
export const getFourTypeDetail = (id: number) => {
  return axios.get('/demandFourType/getDetail', { params: { id } });
};

// 导入
export const importFourType = (formData: any) => {
  return axios.post('/demandFourType/importExcel', formData,{
    headers: {
      'Content-Type': 'multipart/form-data',
    },
  });
};
//导出
export const exportFourType = (data: any) => {
  return axios.post('/demandFourType/downloadExcel', data);
};